package com.echo.http;

import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.toolbox.Volley;
import com.echo.SportsApplication;
import com.echo.activity.SportsActivity;

/**
 * Created by EchoGe on 2016/4/23.
 */
public class VolleyRequestManager {
    public static RequestQueue mRequestQueue= Volley.newRequestQueue(SportsApplication.getInstance());

    public static void addRequest(Request<?> request, Object tag){
        if(tag!=null){
            request.setTag(tag);
        }
        mRequestQueue.add(request);
    }

    public static void cancelRequest(Object tag){
        mRequestQueue.cancelAll(tag);
    }
}
